package com.songlanyun.modules.usergains.service;

import com.songlanyun.common.drive.IBaseService;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.modules.account.entity.AccountEntity;
import com.songlanyun.modules.account.model.vo.AccountParentVO;
import com.songlanyun.modules.gains.entity.ShopOrderGains;
import com.songlanyun.modules.pointconfig.entity.PointConfig;
import com.songlanyun.modules.user.entity.SysUserEntity;
import com.songlanyun.modules.usergains.entity.UserOrderGains;
import com.songlanyun.modules.usergains.model.*;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 会员分佣所得表
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2020-12-22 15:21:52
 */
public interface UserOrderGainsService extends IBaseService<Long, UserOrderGains>,IDistributionHandle{

    PageUtils queryPage(Map<String, Object> params);

    List<UserOrderGainsVo> queryList(Map<String, Object> params);

    UserOrderGains createGains(ShopOrderGains shopOrderGains, UserOrderGainsTo to);

    @Override
    List<UserOrderGains> handle(ShopOrderGains shopOrderGains);

    void refundDeduct(ShopOrderGains obj);

    List<UserOrderGains> loadByShopGains(Long shopId,Long shopGainsId);

    void manualSettlement(Long shopId,SettlementUserOrderGainsDTO dto);

    UserOrderGainsStatisticsVo slimStatistics(Long userId);

    UserOrderGainsStatisticsVo statistics(Long userId);

    BigDecimal loadByWaitAccount(Long userId);

    BigDecimal givePointDecCommissionAble(PointConfig config, BigDecimal allActivationUseCommissionAble, BigDecimal sum, AccountEntity entity);



    void updateCommission(SysUserEntity sysUserEntity, UpdateCommissionDTO dto);

    AirdropStatisticsVo airdropStatistics();


    //查询未结算的订单结算数据
    List<UserOrderGains> queryNotResultOrderGains(Long childOrderId);

}

